import router from '@/router/index'
import {userInfoStore} from '@/stores/user/userInfo'
import {store as stores} from 'stores/index'
const store=userInfoStore(stores);

router.beforeEach(async(to, from, next) => {

    console.info(to.path)
    // const userStorage=localStorage.getItem('userStorage') ?? ''
    const roles=store.rolesInfo
    console.info(roles)
    if(to.path=='/'){
        next();
        
    }else{
        if(roles[0].path==''){
           
            const zhi=await store.getRouterInfo();
            localStorage.setItem('userStorage','222')
            next({
                ...to,
              });
        }else{
            console.info(router)
            next()
        }
    }
    

  }) 